package com.netease.pris.a;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Environment;
import android.os.StatFs;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.MotionEvent;
import android.view.WindowManager;
import com.netease.g.b;
import java.lang.reflect.Method;
import java.util.Locale;

public class u
{
  static final String a = "PhoneUtil";
  static int b = -1;
  static int c = -2;
  static int d = 2;
  static int e = -4;
  static int f = -5;
  static int g = 1;
  static int h = -7;
  static int i = -8;
  static int j = -9;
  static int k = 3;
  static int l = 0;
  static int m = -12;
  static int n = -13;

  static
  {
    switch (q.a())
    {
    default:
    case 9:
    case 8:
    case 5:
    case 6:
    case 7:
    case 4:
    }
    while (true)
    {
      return;
      m = 12;
      n = 11;
      i = 10;
      j = 9;
      h = 8;
      b = 7;
      f = 6;
      e = 5;
      c = 4;
    }
  }

  public static int a(Context paramContext)
  {
    int i1 = 0;
    t localt = c(paramContext);
    switch (o.b[localt.ordinal()])
    {
    case 5:
    case 6:
    default:
    case 1:
    case 2:
    case 3:
    case 4:
    }
    while (true)
    {
      return i1;
      i1 = 2;
      continue;
      i1 = 1;
      continue;
      i1 = 3;
    }
  }

  public static j a(String paramString)
  {
    j localj;
    if ((paramString == null) || (paramString.length() <= 0))
      localj = j.g;
    while (true)
    {
      return localj;
      String str = paramString.toLowerCase();
      if (str.startsWith(g.b))
      {
        localj = j.b;
        continue;
      }
      if (str.startsWith(g.a))
      {
        localj = j.a;
        continue;
      }
      if (str.startsWith(g.d))
      {
        localj = j.d;
        continue;
      }
      if (str.startsWith(g.c))
      {
        localj = j.c;
        continue;
      }
      if (str.startsWith(g.f))
      {
        localj = j.f;
        continue;
      }
      if (str.startsWith(g.e))
      {
        localj = j.e;
        continue;
      }
      if (str.startsWith("default"))
      {
        localj = j.g;
        continue;
      }
      localj = j.g;
    }
  }

  public static boolean a()
  {
    if ("mounted".equals(Environment.getExternalStorageState()));
    for (int i1 = 1; ; i1 = 0)
      return i1;
  }

  public static boolean a(String paramString, long paramLong)
  {
    int i1 = 1;
    if (TextUtils.isEmpty(paramString));
    while (true)
    {
      return i1;
      StatFs localStatFs = new StatFs(paramString);
      if (localStatFs.getAvailableBlocks() * localStatFs.getBlockSize() > paramLong)
        continue;
      i1 = 0;
    }
  }

  public static String b()
  {
    return Build.MODEL;
  }

  public static boolean b(Context paramContext)
  {
    NetworkInfo localNetworkInfo = ((ConnectivityManager)paramContext.getSystemService("connectivity")).getActiveNetworkInfo();
    int i1;
    if ((localNetworkInfo == null) || (localNetworkInfo.getType() != 0))
      i1 = 0;
    while (true)
    {
      return i1;
      String str = localNetworkInfo.getExtraInfo();
      if ((str == null) || (str.length() < 3))
      {
        i1 = 0;
        continue;
      }
      if (str.toLowerCase().contains("wap"))
      {
        i1 = 1;
        continue;
      }
      i1 = 0;
    }
  }

  static boolean b(String paramString)
  {
    switch (o.a[a(paramString).ordinal()])
    {
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
    case 7:
    }
    return false;
  }

  public static t c(Context paramContext)
  {
    int i1 = 0;
    ConnectivityManager localConnectivityManager = (ConnectivityManager)paramContext.getSystemService("connectivity");
    t localt;
    if (localConnectivityManager == null)
      localt = t.a;
    while (true)
    {
      return localt;
      NetworkInfo[] arrayOfNetworkInfo = localConnectivityManager.getAllNetworkInfo();
      if (arrayOfNetworkInfo != null)
      {
        int i2 = 0;
        if (i2 < arrayOfNetworkInfo.length)
        {
          if (arrayOfNetworkInfo[i2] == null);
          do
          {
            do
            {
              i2++;
              break;
            }
            while ((!arrayOfNetworkInfo[i2].isAvailable()) || (!arrayOfNetworkInfo[i2].isConnectedOrConnecting()));
            if (arrayOfNetworkInfo[i2].getType() != 1)
              continue;
            localt = t.e;
            break;
          }
          while (arrayOfNetworkInfo[i2].getType() != 0);
          String str = arrayOfNetworkInfo[i2].getExtraInfo();
          if ((str == null) || (str.length() < 3))
          {
            localt = t.d;
            continue;
          }
          if (str.toLowerCase().endsWith("wap"))
          {
            localt = t.c;
            continue;
          }
          localt = t.d;
          continue;
        }
        if (i1 < arrayOfNetworkInfo.length)
        {
          if (arrayOfNetworkInfo[i1] == null);
          while (true)
          {
            i1++;
            break;
            b.e("net", "t: " + arrayOfNetworkInfo[i1].getType() + " avail: " + arrayOfNetworkInfo[i1].isAvailable() + " cd: " + arrayOfNetworkInfo[i1].isConnected() + " cing: " + arrayOfNetworkInfo[i1].isConnectedOrConnecting());
          }
        }
      }
      localt = t.b;
    }
  }

  public static boolean c()
  {
    int i1 = 1;
    Method[] arrayOfMethod = MotionEvent.class.getDeclaredMethods();
    int i2 = arrayOfMethod.length;
    int i3 = 0;
    int i4 = 0;
    int i5 = 0;
    while (i3 < i2)
    {
      Method localMethod = arrayOfMethod[i3];
      if (localMethod.getName().equals("getPointerCount"))
        i5 = i1;
      if (localMethod.getName().equals("getPointerId"))
        i4 = i1;
      i3++;
    }
    if ((i5 != 0) && (i4 != 0));
    while (true)
    {
      return i1;
      i1 = 0;
    }
  }

  public static boolean e(Context paramContext)
  {
    int i1 = 0;
    ConnectivityManager localConnectivityManager = (ConnectivityManager)paramContext.getSystemService("connectivity");
    if (localConnectivityManager == null);
    label73: 
    while (true)
    {
      return i1;
      NetworkInfo[] arrayOfNetworkInfo = localConnectivityManager.getAllNetworkInfo();
      if (arrayOfNetworkInfo == null)
        continue;
      for (int i2 = 0; ; i2++)
      {
        if (i2 >= arrayOfNetworkInfo.length)
          break label73;
        if ((arrayOfNetworkInfo[i2] == null) || (!arrayOfNetworkInfo[i2].isAvailable()) || (!arrayOfNetworkInfo[i2].isConnectedOrConnecting()))
          continue;
        i1 = 1;
        break;
      }
    }
  }

  public static String f(Context paramContext)
  {
    return ((TelephonyManager)paramContext.getSystemService("phone")).getSubscriberId();
  }

  // ERROR //
  public static String g(Context paramContext)
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_1
    //   2: aload_0
    //   3: invokestatic 274	com/netease/pris/a/u:h	(Landroid/content/Context;)Ljava/lang/String;
    //   6: astore 4
    //   8: aload 4
    //   10: astore_3
    //   11: aload_3
    //   12: invokestatic 138	android/text/TextUtils:isEmpty	(Ljava/lang/CharSequence;)Z
    //   15: ifeq +12 -> 27
    //   18: aload_0
    //   19: invokestatic 276	com/netease/pris/a/u:i	(Landroid/content/Context;)Ljava/lang/String;
    //   22: astore 6
    //   24: aload 6
    //   26: astore_3
    //   27: aload_3
    //   28: ifnonnull +7 -> 35
    //   31: ldc_w 278
    //   34: astore_3
    //   35: aload_3
    //   36: areturn
    //   37: astore_2
    //   38: aload_2
    //   39: invokevirtual 281	java/lang/Exception:printStackTrace	()V
    //   42: aload_1
    //   43: astore_3
    //   44: goto -17 -> 27
    //   47: astore 5
    //   49: aload_3
    //   50: astore_1
    //   51: aload 5
    //   53: astore_2
    //   54: goto -16 -> 38
    //
    // Exception table:
    //   from	to	target	type
    //   2	8	37	java/lang/Exception
    //   11	24	47	java/lang/Exception
  }

  public static String h(Context paramContext)
  {
    return ((TelephonyManager)paramContext.getSystemService("phone")).getDeviceId();
  }

  public static String i(Context paramContext)
  {
    return ((WifiManager)paramContext.getSystemService("wifi")).getConnectionInfo().getMacAddress();
  }

  public static String j(Context paramContext)
  {
    return ((TelephonyManager)paramContext.getSystemService("phone")).getLine1Number();
  }

  public static float k(Context paramContext)
  {
    DisplayMetrics localDisplayMetrics = new DisplayMetrics();
    ((WindowManager)paramContext.getSystemService("window")).getDefaultDisplay().getMetrics(localDisplayMetrics);
    return localDisplayMetrics.density;
  }

  public static int[] l(Context paramContext)
  {
    DisplayMetrics localDisplayMetrics = new DisplayMetrics();
    ((WindowManager)paramContext.getSystemService("window")).getDefaultDisplay().getMetrics(localDisplayMetrics);
    int i3;
    int i4;
    int[] arrayOfInt;
    if (q.a() >= 5)
    {
      int i5 = localDisplayMetrics.widthPixels;
      int i6 = localDisplayMetrics.heightPixels;
      i3 = i5;
      i4 = i6;
      if (i3 <= i4)
        break label114;
      arrayOfInt = new int[2];
      arrayOfInt[0] = i4;
      arrayOfInt[1] = i3;
    }
    while (true)
    {
      return arrayOfInt;
      int i1 = (int)(localDisplayMetrics.widthPixels / localDisplayMetrics.density);
      int i2 = (int)(localDisplayMetrics.heightPixels / localDisplayMetrics.density);
      i3 = i1;
      i4 = i2;
      break;
      label114: arrayOfInt = new int[2];
      arrayOfInt[0] = i3;
      arrayOfInt[1] = i4;
    }
  }

  public static String m(Context paramContext)
  {
    int[] arrayOfInt = l(paramContext);
    return arrayOfInt[0] + "/" + arrayOfInt[1];
  }

  public static int n(Context paramContext)
  {
    DisplayMetrics localDisplayMetrics = new DisplayMetrics();
    ((WindowManager)paramContext.getSystemService("window")).getDefaultDisplay().getMetrics(localDisplayMetrics);
    return localDisplayMetrics.widthPixels;
  }

  public static int o(Context paramContext)
  {
    DisplayMetrics localDisplayMetrics = new DisplayMetrics();
    ((WindowManager)paramContext.getSystemService("window")).getDefaultDisplay().getMetrics(localDisplayMetrics);
    return localDisplayMetrics.heightPixels;
  }

  public static int p(Context paramContext)
  {
    DisplayMetrics localDisplayMetrics = new DisplayMetrics();
    ((WindowManager)paramContext.getSystemService("window")).getDefaultDisplay().getMetrics(localDisplayMetrics);
    return (int)(0.5F + localDisplayMetrics.widthPixels * localDisplayMetrics.density);
  }

  public static int q(Context paramContext)
  {
    DisplayMetrics localDisplayMetrics = new DisplayMetrics();
    ((WindowManager)paramContext.getSystemService("window")).getDefaultDisplay().getMetrics(localDisplayMetrics);
    return (int)(0.5F + localDisplayMetrics.heightPixels * localDisplayMetrics.density);
  }

  public static String r(Context paramContext)
  {
    Locale localLocale = Locale.getDefault();
    return localLocale.getLanguage() + "-" + localLocale.getCountry();
  }

  public k d(Context paramContext)
  {
    k localk1 = k.k;
    int i1 = ((TelephonyManager)paramContext.getSystemService("phone")).getNetworkType();
    k localk2;
    if (c == i1)
      localk2 = k.a;
    while (true)
    {
      return localk2;
      if (d == i1)
      {
        localk2 = k.b;
        continue;
      }
      if (e == i1)
      {
        localk2 = k.c;
        continue;
      }
      if (f == i1)
      {
        localk2 = k.d;
        continue;
      }
      if (g == i1)
      {
        localk2 = k.f;
        continue;
      }
      if (h == i1)
      {
        localk2 = k.g;
        continue;
      }
      if (i == i1)
      {
        localk2 = k.h;
        continue;
      }
      if (j == i1)
      {
        localk2 = k.i;
        continue;
      }
      if (k == i1)
      {
        localk2 = k.j;
        continue;
      }
      localk2 = localk1;
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.a.u
 * JD-Core Version:    0.6.0
 */